package com.wholesale.utils;

import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wholesale.R;

public class CartCache {
	private View baseView;
	private TextView goodsName;
	private ImageView goodsImage;
	private ImageView isNew;
	private ImageView isPromote;
	private TextView goodsPrice;
	private TextView totalPrice;
	private TextView goodsNumber;
	private TextView goodsAttribute;
	private EditText goodsNumEdit;
	private TextView ladySize;
	private TextView ladySizeLable;
	private LinearLayout ladySizeLayout;
	private Button deteleButton;

	private LinearLayout attributeLayout;
	private LinearLayout sizeLayout;

	public CartCache(View baseView) {
		this.baseView = baseView;
	}

	public TextView getLadySize() {
		if (ladySize == null) {
			ladySize = (TextView) baseView.findViewById(R.id.ladysize_text);
		}
		return ladySize;
	}

	public TextView getLadySizeLable() {
		if (ladySizeLable == null) {
			ladySizeLable = (TextView) baseView
					.findViewById(R.id.ladysize_lable);
		}
		return ladySizeLable;
	}

	public TextView getTotalPrice() {
		if (totalPrice == null) {
			totalPrice = (TextView) baseView.findViewById(R.id.totalPrice_text);
		}
		return totalPrice;
	}

	public TextView getGoodsName() {
		if (goodsName == null) {
			goodsName = (TextView) baseView.findViewById(R.id.cart_goodsName);
		}
		return goodsName;
	}

	public TextView getGoodsPrice() {
		if (goodsPrice == null) {
			goodsPrice = (TextView) baseView.findViewById(R.id.price_text);
		}
		return goodsPrice;
	}

	public TextView getGoodsNumber() {
		if (goodsNumber == null) {
			goodsNumber = (TextView) baseView.findViewById(R.id.quantity_text);
		}
		return goodsNumber;
	}

	public EditText getGoodsNumberEdit() {
		if (goodsNumEdit == null) {
			goodsNumEdit = (EditText) baseView.findViewById(R.id.quantity_edit);
		}
		return goodsNumEdit;
	}


	public ImageView getGoodsImage() {
		if (goodsImage == null) {
			goodsImage = (ImageView) baseView.findViewById(R.id.goodsImage);
		}
		return goodsImage;
	}

	public ImageView getNewImage() {
		if (isNew == null) {
			isNew = (ImageView) baseView.findViewById(R.id.isNew);
		}
		return isNew;
	}

	public ImageView getPromoteImage() {
		if (isPromote == null) {
			isPromote = (ImageView) baseView.findViewById(R.id.isPromote);
		}
		return isPromote;
	}

	public Button getDeteleButton() {
		if (deteleButton == null) {
			deteleButton = (Button) baseView.findViewById(R.id.deteleBtn);
		}
		return deteleButton;
	}

	public TextView getAttributeTextView() {
		if (goodsAttribute == null) {
			goodsAttribute = (TextView) baseView
					.findViewById(R.id.attribute_text);
		}
		return goodsAttribute;
	}

	public LinearLayout getAttributeLayout() {
		if (attributeLayout == null) {
			attributeLayout = (LinearLayout) baseView
					.findViewById(R.id.attributeLayout);
		}
		return attributeLayout;
	}
}
